<!-- application/views/scripts/index/share.mobile.phtml -->
<?php
/* @var $v_items X_Page_ItemList_PItem */
$v_items = $this->items; 
?>
<?php $this->headScript()->appendFile($this->baseUrl("/js/mobile/share.js")); ?>
<?php $this->headLink()->appendStylesheet($this->baseUrl('/css/mobile/share.css'), 'screen'); ?> 
<?php $this->headTitle()->prepend(X_Env::_('p_mobilerenderer_browse_share')); ?>
<?php if ($this->coverflowEnabled) : ?>
	<?php $this->headScript()->appendFile($this->baseUrl("/js/jquery-ui-1.8.4.custom.min.js")); ?>
	<?php $this->headScript()->appendFile($this->baseUrl("/js/jquery.jcoverflip.js")); ?>
	<?php $this->headScript()->captureStart(Zend_View_Helper_Placeholder_Container_Abstract::APPEND); ?>
		$(document).ready( function(){
			jQuery( '#flip' ).jcoverflip({/*
				beforeCss: function( el, container, offset ){
					el.css('z-index', 10000-offset);
					return [
						$.jcoverflip.animationElement( el, { left: ( container.width( )/2 - 210 - 100*(offset/1.5) + 20*offset )+'px', bottom: '20px'  }, { } ),
						$.jcoverflip.animationElement( el.find( 'img' ), { width: Math.max(40,100-10*offset) + 'px' }, {} )
					];
				},
				afterCss: function( el, container, offset ){
					el.css('z-index', 10000-offset);
					return [
						$.jcoverflip.animationElement( el, { left: ( container.width( )/2 + 110 + 100*(offset/1.5) )+'px', bottom: '20px' }, { } ),
						$.jcoverflip.animationElement( el.find( 'img' ), { width: Math.max(40,100-10*offset) + 'px'}, {} )
					];
				},
				currentCss: function( el, container ){
					el.css('z-index', 10000);
					return [
						$.jcoverflip.animationElement( el, { left: ( container.width( )/2 - 100 )+'px', bottom: 0 }, { } ),
						$.jcoverflip.animationElement( el.find( 'img' ), { width: '200px' }, { } )
					];
				},*/
				change: function(event, ui){
					//jQuery('#scrollbar').slider('value', ui.to*25);
					//alert(ui.to);
					$('#wrapper .items .item.highlight').removeClass('highlight');
					$('#wrapper .items .item:eq('+ui.to+')').addClass('highlight');
				},
				titles: {
					create: customTitleCreate,
					destroy: customTitleDestroy
				}
	        });
	        
	        $('#wrapper .items .item:eq(0)').addClass('highlight');
	        
		});
		
		function customTitleCreate(itemElem) {
			
			var title = $('<div class="title"></div>')
				.append(itemElem.find('.title').text());
				
			itemElem.find('.title').hide();
	        
			return title;
		}
		
		function customTitleDestroy( titleElem ) {
			titleElem.fadeOut(function (){titleElem.remove()}); // delete the title element
		}	
		
	<?php $this->headScript()->captureEnd(); ?>
<?php endif; ?>


<div id="site_header"><a
	href="<?php echo $this->url(array('controller' => 'index', 'action' => 'collections'), 'default', true); ?>"
	id="usc_mobile">VLC Shares</a>
	<?php if ( $this->parentLocation !== false ) :?>
		<a
	href="<?php echo $this->url(array('l' => ($this->parentLocation == '' ? null : X_Env::encode($this->parentLocation))), 'default', false); ?>"
	id="app_icon"> <img
	src="<?php echo $this->baseUrl('/images/mobile/back.png'); ?>" /> </a>
	<?php else: ?>
		<a
	href="<?php echo $this->url(array('controller' => 'index', 'action' => 'collections'), 'default', true); ?>"
	id="app_icon"> <img
	src="<?php echo $this->baseUrl('/images/mobile/back.png'); ?>" /> </a>
	<?php endif; ?>
	<?php if ( $this->providerName != '' ) :?>
		<h1 class="site_title"><?php echo X_Env::_("p_{$this->providerName}_collectionindex"); ?></h1>
	<?php else: ?>
		<h1 class="site_title"><?php echo X_Env::_('p_mobilerenderer_noprovider_share'); ?></h1>
	<?php endif; ?>
</div>
<?php if ($this->coverflowEnabled) : ?>
	<div id="thumbs">
		<ul id="flip">
			<?php foreach ($v_items->getItems() as $i => $item):?>
				<?php /* @var $item X_Page_Item_PItem */ ?>
				<li><a href="<?php echo $item->isUrl() ? $item->getLink() : $this->url($item->getLink(), $item->getRoute(), $item->isReset()) ; ?>"> <span class="title"><?php echo $item->getLabel(); ?></span>
						<?php if ($item->getThumbnail() != null ) : ?>
							<?php if ( X_Env::startWith($item->getThumbnail(), 'http') || X_Env::startWith($item->getThumbnail(), 'https') ) : ?>
								<img src="<?php echo $item->getThumbnail(); ?>"	title="<?php echo $item->getLabel(); ?>" />
							<?php else: ?>
								<img src="<?php echo $this->baseUrl($item->getThumbnail()); ?>"	title="<?php echo $item->getLabel(); ?>" />
							<?php endif;?>
						<?php else: ?>
							<img src="<?php echo $this->baseUrl('/images/icons/folder.png'); ?>" title="<?php echo $item->getLabel(); ?>" />
						<?php endif; ?>
					</a></li>
			<?php endforeach; ?>
		</ul>
	</div>
<?php endif; ?>
<div id="wrapper">
<h2><?php echo $this->location; ?></h2>
<ul class="items">
	<!-- 
		<li class="item">
			<img src="http://uscnews.usc.edu/assets_c/2010/10/no smoking-thumb-65x65-27066.jpg"	alt="" />
			<p class="title"><a href="/news/story.php?id=42666">USC Hospitals Go Smoke Free Today</a></p>
			<p class="date">October 1, 2010</p>
			<a href="/news/story.php?id=42666" class="button"></a>
			<div class="clear"></div>
		</li>
		-->
		<?php foreach ($v_items->getItems() as $i => $item):?>
			<?php /* @var $item X_Page_Item_PItem */ ?>
			<li class="item">
				<?php if ( $item->getIcon() != null ): ?>
					<img src="<?php echo $this->baseUrl($item->getIcon()); ?>"	height="32px" width="32px" alt="" />
				<?php endif; ?>
				<p class="title"><a href="<?php echo $item->isUrl() ? $item->getLink() : $this->url($item->getLink(), $item->getRoute(), $item->isReset()) ; ?>"><?php echo $item->getLabel(); ?></a></p>
				<?php if ( $item->getDescription() != null ): ?>
					<p class="date"><?php echo $item->getDescription(); ?></p>
				<?php endif; ?>
				<a href="<?php echo $item->isUrl() ? $item->getLink() : $this->url($item->getLink(), $item->getRoute(), $item->isReset()) ; ?>" class="button"></a>
	<div class="clear"></div>
	</li>
		<?php endforeach; ?>
	</ul>
</div>
<div id="footer">
<ul>
	<li><a id="feedback" href="http://code.google.com/p/vlc-shares/"><?php echo X_Env::_('p_mobilerenderer_footerproject')?></a></li>
	<li><a id="uscHome"
		href="<?php echo $this->url(array('controller' => 'manage', 'action' => 'index' ), 'default', true);?>"><?php echo X_Env::_('p_mobilerenderer_footermanage'); ?></a></li>
	<li><a
		href="<?php echo $this->url(array('controller' => 'index', 'action' => 'collections' ), 'default', true);?>"><?php echo X_Env::_('p_mobilerenderer_footerindex')?></a></li>
</ul>
</div>
